package config

// NacosConfig Nacos的配置信息
type NacosConfig struct {
	Host      string `mapstructure:"host"`
	Port      uint64 `mapstructure:"port"`
	Namespace string `mapstructure:"namespace"`
	User      string `mapstructure:"user"`
	Password  string `mapstructure:"password"`
	DataId    string `mapstructure:"dataid"`
	Group     string `mapstructure:"group"`
}

// JWTConfig JWT配置信息
type JWTConfig struct {
	JwtSign   string `mapstructure:"sign" yaml:"jwtSign"`
	JwtExpire int64  `mapstructure:"expire" yaml:"jwtExpire"`
}

// MysqlConfig 配置信息
type MysqlConfig struct {
	Host     string `mapstructure:"host" json:"host" yaml:"host"`
	Port     int    `mapstructure:"port" json:"port" yaml:"port"`
	DBName   string `mapstructure:"dbName" json:"dbName" yaml:"dbName"`
	UserName string `mapstructure:"userName" json:"userName" yaml:"userName"`
	Password string `mapstructure:"password" json:"password" yaml:"password"`
}

type RedisConfig struct {
	Host     string `mapstructure:"host" json:"host" yaml:"host"`
	Port     int    `mapstructure:"port" json:"port" yaml:"port"`
	Password string `mapstructure:"password" json:"password" yaml:"password"`
	DB       int    `mapstructure:"db" json:"db" yaml:"db"`
}

// ServerConfig 配置信息
type ServerConfig struct {
	Name        string      `mapstructure:"name" json:"name" yaml:"name"`
	Host        string      `mapstructure:"host" json:"host" yaml:"host"`
	Port        int         `mapstructure:"port" json:"port" yaml:"port"`
	Tags        []string    `mapstructure:"tags" json:"tags" yaml:"tags"`
	JwtConfig   JWTConfig   `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
	MysqlInfo   MysqlConfig `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
	RedisConfig RedisConfig `mapstructure:"redis" json:"redis" yaml:"redis"`
}
